import 'package:flutter/material.dart';
import 'package:hi_common/util/color.dart';
import 'package:underline_indicator/underline_indicator.dart';

class HiTabBar extends StatelessWidget {
  final List<Tab> tabs;
  final TabController? controller;
  final double fontSize;
  final double borderWidth;

  const HiTabBar(
      {super.key,
      required this.tabs,
      this.controller,
      this.fontSize = 13,
      this.borderWidth = 3});

  @override
  Widget build(BuildContext context) {
    return TabBar(
      tabs: tabs,
      controller: controller,
      isScrollable: true,
      tabAlignment: TabAlignment.center,
      labelStyle: TextStyle(fontSize: fontSize),
      labelColor: primary,
      indicator: UnderlineIndicator(
          strokeCap: StrokeCap.round,
          borderSide: BorderSide(color: primary, width: borderWidth),
          insets: const EdgeInsets.only(left: 0, right: 0)),
    );
  }
}
